﻿#ifndef ORDERMANAGEBUS_H
#define ORDERMANAGEBUS_H

#include <QWidget>
#include "globalvars.h"
#include "ordermanagemodel.h"
#include "modifyorderstate.h"

namespace Ui {
class OrderManageBus;
}

class OrderManageBus : public QWidget
{
    Q_OBJECT
signals:
    void signalGainOrderManageList(const QString& hotelID);
    void signalModifyOrderState(const QString&, const QString&);

public:
    explicit OrderManageBus(QWidget *parent = nullptr);
    ~OrderManageBus();

    void setOptionalHotel();
    QString getCurrentSelectedHotelID();

public slots:
    void slotUpdateOrderManageShow();
    void slotModifyOrderStateResult(bool result,const QString& msg);

private slots:
    void on_pb_todayAll_clicked();
    void on_pb_yesterdayAll_clicked();
    void on_pb_weekAll_clicked();
    void on_pb_monthAll_clicked();

    void on_pb_todayNo_clicked();
    void on_pb_yesterdayNo_clicked();
    void on_pb_weekNo_clicked();
    void on_pb_monthNo_clicked();

    void on_de_startAll_dateChanged(const QDate &date);
    void on_de_endAll_dateChanged(const QDate &date);
    void on_de_startNo_dateChanged(const QDate &date);
    void on_de_endNo_dateChanged(const QDate &date);

    void on_tabV_all_doubleClicked(const QModelIndex &index);
    void on_pb_update_clicked();

    void on_cb_selectHotel_currentIndexChanged(const QString &arg1);

private:
    Ui::OrderManageBus *ui;

    DaySelect m_selectAll;
    DaySelect m_selectNo;
    void judgeALLSelectState();
    void judgeNoSelectState();

    OrderManageModel *m_modelAll;
    OrderManageModel *m_modelNo;
    ModifyOrderState *m_modifyState;

    QMap<QString,QString> m_hotelIdNameMap;
};

#endif // ORDERMANAGEBUS_H
